Modern computers have become extremely powerful, and can make thousands of calculations per second. These powerful computing resources frequently are employed to display or “render” detailed images on a monitor or television. For example, computers are used to generate realistic images for movies, complex animation for games, and even pictures saved from a camera. To generate these images, a computer may calculate and plot lines, curves, and regions. While a computer may calculate smooth and continuous lines, curves and regions, however, these lines, curves and regions must still be displayed on a monitor or television that has discrete picture elements or “pixels.”
Thus, the smooth lines, curves or regions generated by a computer cannot actually be displayed or “rendered” just as they are generated. They must instead be sampled at discrete locations corresponding to individual pixels. If the features of the line, curve or region occur more frequently than the line, curve or region is sampled for the pixels, however, the sampled image data will not accurately reflect the original generated image data. For example, FIGS. 1A and 1C illustrate two different contours 101 and 103 that may be generated by a computer. As seen in these figures, the features of contour 101 occur more frequently than the features of contour 103. The contours 101 and 103 are sampled at discrete locations 105, to produce corresponding sampled contours 107 and 109 shown in FIGS. 1B and 1D, respectively.
Because the samples 105 of the contour 103 occur at less than half of the frequency as the features of the contour 103 occur, the features of sampled contour 109 are much different than the frequency of the original contour 105. Instead, the sampled counter 109 is identical to the sampled contour 107, even though the appearance of the original contour 101 is much different than the appearance of the original contour 103. In order to accurately sample a line, curve or region, the sample rate must be more than twice the frequency of the features of the line, curve or region being sampled. The sample rate is limited, however, by the number of pixels available (or “resolution”) available on the relevant display device.
This aliasing problem is graphically demonstrated in FIGS. 2A and 2B. As seen in FIG. 2A, a computer may generate a line 201 having a specified width and a specified direction or slope. The generated line 201 will be calculated so as to correspond to specific pixels 203 of a display 205. If each pixel 203a corresponding to the line 201 is activated, however, then the displayed line 207 will be much thicker than the generated line 201 as shown in FIG. 2B. Moreover, the displayed line 207 will appear very jagged to a viewer, quite unlike the smooth generated line 201.
To address this problem, various anti-aliasing techniques have been developed to control the appearance of pixels corresponding with a line, curve or region, so that the edges of the line, curve or region appear more blurred to an observer. For example, as shown in FIG. 3, an anti-aliasing technique might give some of the pixels 203 corresponding to the line 201 a lighter appearance. With some anti-aliasing techniques, the color or intensity of a pixel (that is, the value of a pixel) is assigned based upon the amount of overlap between the pixel and the generated line, curve or region. Moreover, with some of these anti-aliasing techniques, a corresponding pixel might not even be activated if there is insufficient overlap of the pixel with the generated line, curve or region.
A variety of methods have been developed to determine the value assigned to a pixel based upon its overlap with a generated line, curve or region. Some methods determine a pixel's value by dividing the pixel into a number of subpixels, and then determining how many subpixels are intersected by the generated line, curve or region. For example, a pixel having only three subpixels intersected by the generated line, curve or region might be assigned a lower value than a pixel having seven subpixels intersected by the generated line, curve or region. Some anti-aliasing methods will additionally weight each subpixel, so that the subpixels close to the center of a pixel have more influence on the pixel's assigned value than subpixels further away from the pixel's center.
Still other anti-aliasing techniques determine the value of a pixel based upon the total amount of overlap of the pixel with the generated line, curve or region. More particularly, these techniques convolute a continuous weighting function, referred to as a “filter” function, with the area of one or more pixels overlapping generated line, curve or region. The generic convolution equation is given as follows:
      c    ⁢                  ⁢          (      ξ      )        =            ∫      ∞              -        ∞              ⁢                  h        ⁡                  (                      ξ            -            x                    )                    ⁢              y        ⁡                  (          x          )                    ⁢                          ⁢              ⅆ        x            where h(ξ−x) is the convolution kernel and y(x) is the function being convolved. For antialiasing techniques, the function being convolved y(x) is the image function generating the line, curve or region, while the convolution kernel h(ξ−x) is a filter function that is multiplied with the pixel value. The product of the filter function and the image function are then integrated over a predetermined area referred to as the filtering mask. This convolution process is referred to as prefiltering because high frequency features of the image data are filtered from the image data before it is displayed.
A variety of different filtering functions have been employed for antialiasing. For example, box functions, conical functions and Gaussian functions are all commonly employed for antialiasing. Some filtering functions, such as conical and Gaussian functions, are two-dimensional. With these functions, the height of the filter function varies the weight multiplied with the pixel value over different locations within the pixel. A two-dimensional circular or revolutionary filter function may thus provide greater weight to the overlap of a pixel with a generated line, curve or region occurring at the center of the pixel than an overlap occurring at the edge of a pixel.
In addition to using different filter functions, various antialiasing techniques may also employ different filter masks. For example, some antialiasing techniques may employ a square filter mask that covers one or more pixels. Other antialiasing techniques may alternately employ a revolutionary filter mask having a diameter of one, two, three or four or more times the width of a pixel. FIG. 3 illustrates a region 301 that is rendered by a group of pixels 303, each pixel 303 have a center 303A. It also illustrates a revolutionary convolution or filter mask 305 having a diameter two times the width of a pixel 303. As seen in this figure, if the mask 305 is centered on a pixel, it will reach the center of each immediately adjacent pixel.
While a variety of antialiasing techniques have been developed, each of these techniques is usually only suitable for the particular type of image data for which they have been developed. For example, antialiasing techniques developed to render small polygons are typically not very suitable for rendering curves or fonts. Similarly, antialiasing techniques specialized to render curves are not very suitable for rendering polygons or fonts, while antialiasing techniques designed to render fonts are typically not very suitable for rendering polygons or curves. Accordingly, there is a need for an antialiasing technique that will provide good antialiasing for a variety of image data types.